<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var arr = [1,NaN,'1',NaN,2,{a:10},{},{a:{b:10}},{a:10},{a:{b:10}},2,{}]
    var arr2 =arr
    var ind = ""
    arr = arr.map((item,index)=>{
      if(JSON.stringify(item)  == 'null'){
            ind = index
      }
        return JSON.stringify(item)
    })
    // arr = Array.from(new Set(arr))
    arr = arr.map((item,index)=>{
        return JSON.parse(item)
    })
    arr = Array.from(new Set(arr))

    arr.forEach((e,index)=>{
        if(e == null){
            arr[index] = arr2[ind]
        }
    })
    console.log(arr);
    // console.log(JSON.parse(arr));
    // arr = new Set(arr)
    // arr = arr.map(item=>{
    //     return JSON.parse(item)
    // })
    // console.log(arr);
</script>
</html>